import React, { Component } from 'react';
import Button from '@material-ui/core/Button';
import Dialog from '@material-ui/core/Dialog';
import DialogActions from '@material-ui/core/DialogActions';
import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import LinearProgress from '@material-ui/core/LinearProgress';

class DownloadProgressDialog extends Component {
    render() {
        const { open, onClose, progressVal } = this.props;
        return (
            <Dialog
                open={open}
                onClose={onClose}
                scroll="paper"
                aria-labelledby="scroll-dialog-title"
            >
                <DialogTitle id="scroll-dialog-title">Downloading</DialogTitle>
                <DialogContent>
                    <LinearProgress variant="determinate" value={progressVal}/>
                </DialogContent>
                <DialogActions>
                    <Button onClick={onClose} color="primary" disabled={progressVal < 100}>
                        Close
                    </Button>
                </DialogActions>
            </Dialog>
        );
    }
}

export default DownloadProgressDialog;
